<%@ page language="java" import="java.util.*,com.gem.pojo.Users" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>Insert title here</title>
<script type="text/javascript" src="script/jquery-2.1.1.js"></script>
<script type="text/javascript">
function checkPassword() {
	var name = $("#userName").val();
	var pass = $("#password").val();
	if (pass.trim().length < 1) {
		$("#user_password").html("密码不能为空 ").css({
			visibility : "visible"
		});
	}
	<!--BBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBCBBBBB -->
	<!--BBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBCBBBBB -->
	else {
		var part={
				username : name ,
				password : pass
				};
		$.post("/hello/login" , part , callback1);
		}
	
	function callback1(data, status) {
		
		if ("invalid" == data) {
			$("#user_password").html("密码错误  ").css({
				visibility : "visible"
			});
		} else {
			$("#user_password").html("aaaa  ").css({
				visibility : "visible"
			});
			location.href="mainweb.html";
		} 
</script>
<script type="text/javascript">

$(document).ready(function(){
	$("#getall").click( function(){
				//var pn = $(this).text();//#gotopagenum是文本框的id属性  
				location.href = "getalluser?";
					}
				);
	$("li").mouseover( function(){
					$(this).css({"color":"blue","cursor":"hand"});
								 }
					);
	
	$("li").mouseout( function(){
					$(this).css({"color":"black"});
									   }
							 );
	$("#name").focus( function(){
					if($("#name").val()=="-请输入用户名-"){
						//alert($(this).val());
						$("#name").val("");
						}

								});
	$("#name").blur( function(){
								if($(this).val()==""){
									alert("用户名不能为空");
									$("#name").focus();
								}
							  }
					);
	   });
</script>
	
<style type="text/css">
<!--

#apDiv1 {
	position:relative;
	width:1000px;
	height:300px;
	z-index:1;
	
	margin:0 auto;
}
body {
	margin-top: 0px;
}
#topdiv {
	position:absolute;
	width:1000px;
	height:100px;
	z-index:2;
	background-image: url(images/boshitop.jpg);
}
#leftdiv {
	position:absolute;
	width:200px;
	height:400px;
	z-index:2;
	top:100px;
}
#rightdiv {
	position:absolute;
	width:800px;
	height:400px;
	top:100px;
	left:200px;
	z-index:3;
}
#bottondiv {
	position:absolute;
	top:500px;
	left:0px;
	width:1000px;
	height:50px;
	z-index:4;
	text-align:center;
}
#righttopdiv {
	position:absolute;
	width:800px;
	height:50px;
	z-index:3;
	text-align:justify;
	
}
#rightbottom {
	position:absolute;
	top:50px;
	width:800px;
	height:350px;
	z-index:3;
	background-color: #66CC33;
}
#search {
	position:absolute;
	top:10px;
	left:300px;
	width:400px;
	height:50px;
	z-index:1;
}
-->
</style>
<link href="css/mainweb.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="apDiv1">
  <div id="topdiv"></div>
  <div id="leftdiv">
  <br><br>
   <caption>用户管理</caption>
    <ol>
    	<li id="getall">查看所有用户</li>
        <li >查看所有用户</li>
        <li>查看所有用户</li>
        <li>查看所有用户</li>
    </ol>
    <caption>图书管理</caption>
    <ol>
    	<li>图书分类管理</li>
        <li>查看图书</li>
        <li>添加图书</li>
        
    </ol>
  </div>
  <div id="rightdiv">
	<div id="righttopdiv">
		<%
			if(session.getAttribute("user")!=null){
		%>
			当前用户：<%=request.getParameter("uid") %>
		<%
			}else{
				%>
			<a href="login.jsp">请登录</a>
		<%		
			}
		%>
	  <div id="search">
    <form id="serch" action="" method="get">
    	<input name="txtserch" type="text" class="txtserch" id="txtserch" /><input name="btnserch" type="button" class="btnsearch" value="搜索" />
    </form>
    </div>
    </div>
    <div id="rightbottom">
    	<table width="600" height="200" border="1">
  <tr>
    <td>用户ID</td>
    <td>姓名</td>
    <td>地址</td>
    <td>电话</td>
    <td>性别</td>
    <td>金额</td>
  </tr>
  <%	if(request.getAttribute("alluser")!=null & session.getAttribute("user")!=null){
			request.setCharacterEncoding("utf-8");
			List list=(List)request.getAttribute("alluser");
			Iterator it=list.iterator();
			while(it.hasNext()){
				Users u=(Users)it.next();
			%>
  <tr>
    <td><%=u.getUid()%></td>
    <td><%=u.getUname()%></td>
    <td><%=u.getUaddress()%></td>
    <td><%=u.getuPhone()%></td>
    <td><%=u.getUsex()%></td>
    <td><%=u.getUmoney()%></td>
  </tr>

	
			
	<%
		}
			}
	%>
</table> 
    
    
    
    </div>
  </div>
  <div id="bottondiv">
    <p class="">
				24小时客户服务热线：010-68988888 &#160;&#160;&#160;&#160;
				<a href="#">常见问题解答</a> &#160;&#160;&#160;&#160; 新闻热线：010-627488888
				<br />
				文明办网文明上网举报电话：010-627488888 &#160;&#160;&#160;&#160; 举报邮箱：
				<a href="#">jubao@jb-aptech.com.cn</a>
	</p>
	<p class="copyright">
				Copyright &copy; 2014-2019 boshi.com , All Right Reserver
				<br />
				博识图书 版权所有
	</p>
  </div>
</div>
</body>
</html>